package com.hisense.ovcloud.warehouse.config;

import com.hisense.ovcloud.warehouse.dto.req.ActivateDeviceReq;
import com.hisense.ovcloud.warehouse.service.DevicesService;
import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Mono;

import javax.annotation.PostConstruct;

@Configuration
public class InitShardingJdbc {
    private final DevicesService devicesService;

    public InitShardingJdbc(DevicesService devicesService) {
        this.devicesService = devicesService;
    }

    @PostConstruct
    public void initSharding(){
        devicesService.getPublicKey(Mono.just(ActivateDeviceReq.builder().physicalDeviceId("1").needToken(false).build()));
    }
}
